<?php

require_once("conf/db_connection.php");

$search = $_POST['search'];

if($search!="")
{
$query_smsin="SELECT * FROM smsin where smsfr like '%".$search."%'
OR smsmsg like '%".$search."%' 
OR smsdt like '%".$search."%'";
$result_smsin=mysql_query($query_smsin);
}

else
{
$query_smsin="SELECT * FROM smsin";
$result_smsin=mysql_query($query_smsin);
}
?>
<html>
<head>
<script type="text/javascript" src="lib/js/main.js"></script>
<style type = "text/css">
#hor-minimalist-b {
	background-color: #FFFFFF;
    border-collapse: collapse;
    font-family: Georgia;
    font-size: 12px;
    margin: 10px;
    text-align: center;
    width: 900px;
}
#hor-minimalist-b th {
    border-bottom: 2px solid #5F0C0C ;
    color: #5F0C0C;
    font-size: 12px;
    font-weight: bold;
    padding: 10px 8px;
	width: 300px;
}
#hor-minimalist-b td {
    border-bottom: 1px solid #888888;
    color: #000000;
    padding: 6px 8px;
}
#hor-minimalist-b tbody tr:hover td {
    //color: #0000CC;
	background-color:#BCC5C6;
	
}
</style>
</head>
<body>
<table border='1' width='900' style='background-color:black;margin-left:auto;margin-right:auto;background-color:#5F0C0C;color:white;font-family:Georgia;font-size:12px'>
<th>INBOX</th>
</table>
<form action = 'smsin_list.php' method = 'post'>
<table width='900' style='background-color:black;margin-left:auto;margin-right:auto;color:white;font-family:Georgia;font-size:12px'>
<tr>
<td align = 'right'><input type = 'submit' id = 'submit' name = 'submit' value = 'Search' />&nbsp;<input type = 'text' id = 'search' name = 'search' /></td>
</tr>
</table>
</form>
<table id='hor-minimalist-b' border='0' width='100%' style='margin-left:auto;margin-right:auto'>
<thead>
<tr>
	<th>From</th>
	<th>Message</th>
	<th>Date/Time</th>
</tr>
</thead>
<?php
while($row_smsin = mysql_fetch_array($result_smsin))
{
?>
<tbody>
<tr>
	<td style="text-align:center; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_smsin["smsfr"] ?>&nbsp;</td>
	<td style="text-align:center; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_smsin["smsmsg"] ?>&nbsp;</td>
	<td style="text-align:center; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_smsin["smsdt"] ?>&nbsp;</td>
</tr>
</tbody>
<?php
}
?>
</table>		
</body>
</html>

